<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTagsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('tags', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name',100)->default('')->unique()->commnet('标签');
	        $table->integer('parent_id')->default(0)->unsigned()->comment('父级id');
	        $table->tinyInteger('status')->default(1)->comment('状态，-0删除，0禁用，1正常');
	        $table->index('parent_id');
        });
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `tags` comment '文章标签表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('tags');
    }
}
